﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using Interfaces;
using Controller;

namespace GUI
{
    public partial class FrmPostRap : Form
    {
        // attribut
        EmmaSystem system;

        // konstruktør
        public FrmPostRap(EmmaSystem system)
        {
            InitializeComponent();

            this.system = system;
        }

        // form load hændelse
        private void FrmPostRap_Load(object sender, EventArgs e)
        {
            this.IPosteringsdataBindingSource.DataSource = system.GetPosteringsliste();     // datasourcen = listen af posteringer
            this.rpvPosteringer.RefreshReport();
        }

        // luk-knap
        private void btnLuk_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        // send-knappen
        private void btnSend_Click(object sender, EventArgs e)
        {
            FrmSendEmail frmSendMail = new FrmSendEmail(system, rpvPosteringer);
            this.Hide();
            frmSendMail.ShowDialog();
            this.Show();
        }
    }
}
